#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtWidgets/QMainWindow>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QProgressBar>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QTextEdit>
#include <QtWidgets/QDateEdit>
#include <QtWidgets/QTableWidget>
#include <QtWidgets/QFileDialog>
#include <QMainWindow>
#include <QTableWidget>
#include <QHeaderView>
#include <QWidget>
#include <QLineEdit>
#include <QComboBox>
#include <QDateEdit>
#include <QLabel>
#include <QProgressBar>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>
#include <QProgressBar>
#include <QComboBox>
#include <QTextEdit>
#include <QDateEdit>
#include <QTableWidget>
#include <QFileDialog>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include "aichatdialog.h"
#include "historywindow.h"
#include "advicewindow.h"
#include "trendwindow.h"
#include "trendwindow.h"


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void calculateBMI();
    void generateReport();
    void predictTrend();
    void setGoal();
    void loadHistory();
    void exportHistory();
    void openAIChat();

private:
    QLineEdit *weightInput;
    QLineEdit *heightInput;
    QComboBox *genderInput;
    QComboBox *ageGroupInput;
    QDateEdit *dateInput;
    QLabel *bmiResult;
    QLabel *bmiCategory;
    QProgressBar *bmiProgress;
    QPushButton *calculateButton;
    QPushButton *reportButton;
    QPushButton *predictButton;
    QPushButton *goalButton;
    QPushButton *historyButton;
    QPushButton *exportButton;
    QPushButton *aiChatButton;
    QTextEdit *reportOutput;
    QTableWidget *historyTable;

    QString getHealthAdvice(double bmi, const QString &gender, const QString &ageGroup);
    void saveToHistory(const QDate &date, double bmi, const QString &category);
};

#endif // MAINWINDOW_H
